package com.adam.seataorder.order.controller;


import com.adam.seataorder.order.entity.Order;
import com.adam.seataorder.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author LiDaXing
 * @since 2023-04-03
 */
@RestController
@RequestMapping("/order/order")
public class OrderController {

    @Autowired
    private OrderService orderService;

    @RequestMapping(value = "/createOrder")
    public void createOrder(String userId, int money, String commodityCode) {

        Order order = new Order();
        order.setUserId(userId);
        order.setCommodityCode(commodityCode);
        order.setMoney(money);

        orderService.createOrder(order);

    }

}
